mod readability_new;
mod article_extractor;
mod seconds;

use seconds::Seconds;
use anyhow::Result;
use std::sync::Arc;
use tracing::info;

use url::Url;

pub async fn parse(
    url: Arc<Url>
) -> Result<ParserOutput> {
    info!("start parsing");
    let mut output = ParserOutput {
        title: None,
        duration: None,
    };
    info!("{:#?}", url.domain());
        let readability_output = readability_new::readability(/*html,*/ url).await;
    println!("{:#?}", readability_output);
    if let Ok(readability_output) = readability_output {
        output.title = Some(readability_output.title);
    }
    Ok(output)
}
use serde::Deserialize;
#[derive(Debug, Deserialize)]
pub struct ParserOutput {
    pub title: Option<String>,
    pub duration: Option<Seconds>,
}
